package luogu;

import java.util.Scanner;

public class A2404 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        dfs(n);
    }
    static void dfs(int n){

        if(n==1)System.out.print(1);
        for(int i=1;i<n;i++){
            System.out.print(i+" ");
            dfs(n-i);
        }
    }
}
